package com.wangdao.wechatmall.controller.admin;

import com.wangdao.wechatmall.bean.bo.admin.StatUserBO;
import com.wangdao.wechatmall.bean.vo.admin.BaseRespVo;
import com.wangdao.wechatmall.bean.vo.admin.StatGoodsVO;
import com.wangdao.wechatmall.bean.vo.admin.StatOrderVO;
import com.wangdao.wechatmall.service.admin.StatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * StatController
 * created by feng on 7/9/21
 */
@RestController
@RequestMapping("admin/stat")
public class StatController {

    @Autowired
    StatService statService;

    //http://localhost:8083/admin/stat/user
    @GetMapping("user")
    public BaseRespVo user() {
        StatUserBO statUserBO = statService.user();

        return BaseRespVo.ok(statUserBO);
    }

    //http://182.92.235.201:8083/admin/stat/order
    @GetMapping("order")
    public BaseRespVo order() {
        StatOrderVO statOrderVO = statService.order();
        return BaseRespVo.ok(statOrderVO);
    }

    //http://localhost:8083/admin/stat/goods
    @GetMapping("goods")
    public BaseRespVo goods() {
       StatGoodsVO statGoodsVO = statService.goods();
       return BaseRespVo.ok(statGoodsVO);
    }

}